﻿<div ng-controller="declarationController">
    <div class="wrapper border-bottom white-bg page-heading">
        <div class="col-lg-pull-12">
            <ol class="breadcrumb">
                <li class="active">商户入驻列表</li>
            </ol>
        </div>
    </div>
    <form class="form-horizontal row">
        <div class="form-group col-sm-4">
            <label class="col-sm-4 control-label">姓名</label>
            <div class="col-sm-8">
                <input type="text" class="form-control input-sm" ng-model="query.name">
            </div>
        </div>
        <div class="form-group col-sm-4">
            <label class="col-sm-4 control-label">手机</label>
            <div class="col-sm-8">
                <input type="text" class="form-control input-sm" ng-model="query.mobile">
            </div>
        </div>
        
        <div class="form-group col-sm-4">
            <label class="col-sm-4 control-label"></label>
            <div class="col-sm-8">
                <a class="btn btn-primary btn-sm" ui-sref="app.declaration.list(query)"><i class="fa fa-search"></i> 查询</a>
                <button class="btn btn-primary btn-sm" type="button" ng-click="search()"><i class="fa fa-refresh"></i>刷新</button>
                <a class="btn btn-primary btn-sm" ui-sref="app.declaration.detail({action:'add'})"><i class="fa fa-plus"></i> 添加</a>
            </div>
        </div>
    </form>
    <ul class="nav nav-tabs">
        <li role="presentation" ng-class="{'active':query.auth_status==''}"><a ui-sref="app.declaration.list({auth_status:''})">全部</a></li>
        <li role="presentation" ng-class="{'active':query.auth_status=='0'}"><a ui-sref="app.declaration.list({auth_status:'0'})">待缴费</a></li>
        <li role="presentation" ng-class="{'active':query.auth_status=='1'}"><a ui-sref="app.declaration.list({auth_status:'1'})">待审核</a></li>
        <li role="presentation" ng-class="{'active':query.auth_status=='2'}"><a ui-sref="app.declaration.list({auth_status:'2'})">审核通过</a></li>
        <li role="presentation" ng-class="{'active':query.auth_status=='3'}"><a ui-sref="app.declaration.list({auth_status:'3'})">审核不通过</a></li>
    </ul>
    <table class="table table-hover m-t-md">
        <thead>
            <tr style="background-color:#f7f7f9;">
                <th width="80">商户姓名</th>
                <th width="80">商户账号</th>
                <th width="80">国家/地区</th>
                <th width="100">企业类型</th>
                <th width="100">企业名称</th>
                <th width="100">营业执照</th>
                <th width="100">审核状态</th>
                <th width="100">创建时间</th>
                <th width="230">操作</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="item in list.rows">
                <td>{{item.name}}</td>
                <td>+{{item.mobile_code}}{{item.mobile}}</td>
                <td>{{item.country}}</td>
                <td>{{get_company_type(item.company_type)}}</td>
                <td>{{item.company_name}}</td>
                <td>
                    <div class="media">
                        <div class="media-body">
                            <img class="media-object img-thumbnail" ng-src="{{site.img_url+item.license|thumbnail:64:64}}">
                            <img class="media-object img-thumbnail" ng-src="{{site.img_url+item.license1|thumbnail:64:64}}">
                            <img class="media-object img-thumbnail" ng-src="{{site.img_url+item.license2|thumbnail:64:64}}">
                            <!--<a href="{{site.img_url+order_item.thumbnails_url}}" target="_blank" class="thumbnail" style="width:60px;height:60px;">
                                    <img ng-src="{{site.img_url+order_item.thumbnails_url}}" ng-show="order_item.shop_domain" width="60" height="60">
                            </a>-->
                        </div>
                    </div>
                </td>
                <td>{{get_audit_status(item.auth_status)}}</td>
                <td>{{item.create_time}}</td>
                <td>
                    <a class="btn btn-primary btn-xs" ui-sref="app.declaration.detail({action:action,id:{{item.id}}})"><i class="fa fa-cog"></i> 编辑</a>
                    <a class="btn btn-primary btn-xs" ui-sref="app.declaration.detail({action:'audit',id:item.id})"><i class="fa fa-cog"></i> 审核</a>
                    <!--<a class="btn btn-primary btn-xs" ui-sref="app.merchant.auth({id:item.id})"><i class="fa fa-address-card"></i> {{auth_status_name(item.auth_status)}}</a>-->
                    <a class="btn btn-primary btn-xs" href="javascript:void(0);" ng-click="remove(item.id)"><i class="fa fa-trash"></i> 删除</a>
                </td>
            </tr>
        </tbody>
    </table>
    <div class="row">
        <div class="col-md-12">
            <uib-pagination total-items="list.total_result" items-per-page="list.size" ng-model="list.page" num-pages="list.total_pages"
                            ng-change="search_page(list.page)" class="pagination-sm" boundary-links="true" boundary-link-numbers="true" max-size="20"
                            previous-text="&lsaquo;" next-text="&rsaquo;" first-text="&laquo;" last-text="&raquo;"></uib-pagination>
            <span class="pull-right" style="margin: 30px 0px 20px 0px">共{{list.total_result}} 当前：{{list.page}}/{{list.total_pages}}</span>
        </div>
    </div>
</div>